﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace NfsCommon.UpoadHepler
{

    public class UploadConfigContext
    {
        private static readonly object olock = new object();

        static UploadConfigContext()
        {
        }

        public static string uploadPath;
        public static string uploadPaths;
        public static string UploadPath
        {
            get
            {
                if (uploadPath == null)
                {
                    lock (olock)
                    {
                        if (uploadPath == null)
                        {

                            if (HttpContext.Current != null)
                            {
                                uploadPath = HttpContext.Current.Server.MapPath("~/" + "Upload");
                            }
                        }
                    }
                }

                return uploadPath;
            }
        }
        public static string UploadPaths
        {
            get
            {
                if (uploadPaths == null)
                {
                    lock (olock)
                    {
                        if (uploadPaths == null)
                        {

                            if (HttpContext.Current != null)
                            {
                                uploadPaths = HttpContext.Current.Server.MapPath("/");
                            }
                        }
                    }
                }

                return uploadPaths;
            }
        }

    }
}

